<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
onload = function(){
	var num = parseInt(Math.random()*10);
	for(var i=0;i<num;i++){
		d1.innerText+=i;
	}	
}
</script>
</head>
<body>
<div id = "d1"></div>
</body>
</html>